package com.stenio.fancat;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.stenio.fancat.common.PageHelperInterceptor;

/**
 * 拦截器注册类
 * 
 * @author stenio
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

	
//	@Autowired
//	private RequestInterceptor requestInterceptor;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 请求控制拦截，暂时不开启，后期统一设计处理
//		registry.addInterceptor(requestInterceptor).addPathPatterns("/**");
		// registry.addInterceptor(getPageHelperInterceptor());
	}

	@Bean
	public HandlerInterceptor getPageHelperInterceptor() {
		HandlerInterceptor pageInterceptorRegistry = new PageHelperInterceptor();
		return pageInterceptorRegistry;
	}

}
